/*
 * Copyright 2020 tu.cn All right reserved. This software is the
 * confidential and proprietary information of tu.cn ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Tu.cn
 */
package com.onedec.materials.service.serviceimp;

import com.onedec.materials.entity.OnedecProject;
import com.onedec.materials.entity.OnedecReceipt;
import com.onedec.materials.entity.OnedecReceiptExample;
import com.onedec.materials.mapper.OnedecReceiptMapper;
import com.onedec.materials.service.ReceiptService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 31014
 * @date 2020/7/22 2:36
 */
@Service
public class ReceiptServiceImpl implements ReceiptService {
    @Resource
    private OnedecReceiptMapper onedecReceiptMapper;

    public void insertReceipt(OnedecReceipt onedecProject) {
        onedecReceiptMapper.insertSelective(onedecProject);
    }

    public List<OnedecReceipt> selectReceipt(String projectNo, Integer inPash) {
        final OnedecReceiptExample receiptExample = new OnedecReceiptExample();
        receiptExample.createCriteria().andReceiptReceipt2EqualTo(projectNo).andReceiptOperationNumEqualTo(inPash);
        final List<OnedecReceipt> receipts = onedecReceiptMapper.selectByExample(receiptExample);
        return receipts;
    }
}